Rem
File:	TEntitySystem.bmx
History:
	-4.09.10 Created By Maximilian Micko

(c)Rainbow Productions
Part of the Rainbow-Enging(R)
End Rem
	



Type tEntitySystem
	Field fIdSystem:tIdSystem
	
	Method New()
		fIdSystem:tIdSystem = New tIdSystem
	End Method
	
	Method Register:Byte(entity:tEntity Var)
		Local id:String = fIdSystem.Register(entity)
		If (id)
			entity.id = id
			Return True
		Else
			Return False
		Endif
	End Method
	
	Method GetEntityById:tEntity(id:String)
		Return tEntity(fIdSystem.Get(id))
	End Method
	
	Method GetIdSystem:tIdSystem()
		Return fIdSystem
	End Method
End Type

Type tEntity
	Field Listeners:tEventListeners
	Field id:String
	
	'Should be called when creating a new Entity
	Method BasicInit()
		Listeners = New tEventListeners
	End Method
End Type